Skip to content

docs(ui): add stories for blog index page#2679

Open
IestynGage wants to merge 1 commit intonpmx-dev:mainfrom
IestynGage:main
Open

docs(ui): add stories for blog index page#2679
IestynGage wants to merge 1 commit intonpmx-dev:mainfrom
IestynGage:main

Conversation

@IestynGage
Copy link
Copy Markdown

🔗 Linked issue

#2150

🧭 Context

Noticed this issue still had missing storybooks and it was labelled with Help wanted, so I added the storybook.

📚 Description

Added the storybook for the blog index. Seems to be working just fine. I looked at the other page storybooks and followed the convention used.

Screenshot 2026-05-05 at 23 39 17

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment May 8, 2026 6:47pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview May 8, 2026 6:47pm
npmx-lunaria Ignored Ignored May 8, 2026 6:47pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f2932a38-ba8f-4bd4-b58d-5274e373b2d0

📥 Commits

Reviewing files that changed from the base of the PR and between 91f3284 and 3e50452.

📒 Files selected for processing (1)
  • app/pages/blog/another-blog.md
✅ Files skipped from review due to trivial changes (1)
  • app/pages/blog/another-blog.md

📝 Walkthrough

Summary by CodeRabbit

  • Tests

    • Added a Storybook story for the Blog index with fullscreen layout and a default story stub.
  • Documentation

    • Added a new published blog page with metadata and structured content (sections and excerpt).

Walkthrough

Adds a Storybook story file at app/pages/blog/index.stories.ts that imports the Blog component, Storybook Vue types, and a page decorator; defines meta with fullscreen layout and the decorator; and exports meta and a Default story stub. Also adds a new blog page app/pages/blog/another-blog.md with YAML frontmatter and markdown content.

Changes

Blog Component Story

Layer / File(s) Summary
Story Setup
app/pages/blog/index.stories.ts
Imports Blog, Meta/StoryObj from @storybook-vue/nuxt, and pageDecorator from .storybook/decorators.
Meta Configuration
app/pages/blog/index.stories.ts
Adds const meta = { component: Blog, parameters: { layout: 'fullscreen' }, decorators: [pageDecorator] } satisfies Meta<typeof Blog>
Story Export
app/pages/blog/index.stories.ts
Exports default meta, defines type Story = StoryObj<typeof meta>, and exports export const Default: Story = {}.

Blog Markdown Page

Layer / File(s) Summary
Frontmatter
app/pages/blog/another-blog.md
Adds YAML frontmatter with authors, title, tags, excerpt, date, slug, image, description, and draft: false.
Content Body
app/pages/blog/another-blog.md
Adds markdown body with headings “Toast”, “Potatoes”, and “Conclusion” and associated paragraphs.

Suggested reviewers

  • ghostdevv
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a Storybook story file for the blog index page, which is the primary addition in this PR.
Description check ✅ Passed The description provides relevant context about the PR, linking to the related issue, explaining the motivation, and describing the work completed—all directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Hello! Thank you for opening your first PR to npmx, @IestynGage! 🚀

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any issues you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Vercel

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@ghostdevv ghostdevv changed the title docs(ui): add stories for blog index page #2601 docs(ui): add stories for blog index page May 5, 2026
@ghostdevv
Copy link
Copy Markdown
Contributor

@cylewaitforit if you have time would you be able to take a look? no rush or pressure!

Copy link
Copy Markdown
Contributor

@cylewaitforit cylewaitforit May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new story renders fine in the PR's deployed storybook .

@ghostdevv I don't have access to check the Chromatic tests anymore so you may want to check what the visual regression tests capture.

It looks like the blogs that are being displayed are live data. So my assumption is that would probably mean the chromatic tests would suddenly be out of date when a new blog post is added.

So while I know both are ultimately wanted, we would need to decide if disabling visual regression tests on this page to start would be a blocker to merging or if increasing the coverage of our documented pages is a fine enough short term goal.

If documenting to start is the more important goal then we could add the chromatic parameter to disable.

const meta = {
  component: Blog,
  parameters: {
    layout: 'fullscreen",
    // Disables Chromatic's snapshotting on a component level
    chromatic: { disableSnapshot: true },
  },
  decorators: [pageDecorator],
} satisfies Meta<typeof Blog>;

https://www.chromatic.com/docs/disable-snapshots/#with-storybook

We would probably want to then add a follow up issue to mock out the blog posts in order to re-enable snapshots.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update:

I have access to the chromatic tests again and understandably the snapshot has the same live data. So I think my assumption that new blog data would cause the snapshot to become outdated seems correct.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you take a look @IestynGage 👀

Copy link
Copy Markdown
Author

@IestynGage IestynGage May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cylewaitforit Could you clarify what you mean by live data? From your suggestion I thought the blog posts was from a CMS system. But if you see the spurios commit I added where I create a blog post. The storybook correctly updated. Kinda suggests to me that the cards are built by SSG. This works only if you restart nuxt/vite.

IDK maybe I'm missing something but it seems like they are built by a vite module in modules/blog.ts which creates a object in .nuxt/blog/posts.ts. If i'm missing something I'm happy to add the chromatic: { disableSnapshot: true }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IestynGage At the risk of sounding like an LLM "You are totally right". The npmx pages don't have a ton of SSG. So I was not thinking with that SSG part of my brain at all, and fell back to the idea of needing to mock the things that change like we need to for the other stories. But those changes we are mocking against all happen outside of the PRs.

Since the blog changes would only happen through the PR pipeline where the new chromatic changes can(and should) be reviewed, this is actually a great thing to have a visual regression test on.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For completeness I had started down the path of https://storybook.js.org/docs/writing-stories/mocking-data-and-modules/mocking-modules but I think this default story showing the actual static posts is appropriate.

Copy link
Copy Markdown
Author

@IestynGage IestynGage May 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I looked into trying the mock modules. However it didn't seem to work and vite/storybook/nuxt was complaining . When I was trying to figure out why is when I stumbled upon the SSG code.

Note I suspect storybook sb.mock() is intended to mock functions only 🤔 And you need to mock the whole module using the mock files to mock a exported module. I never got to the bottom of why what I was doing was incorrect so perhaps I missed something.

Comment thread app/pages/blog/another-blog.md Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this test. This helped me think through the blog workflow better. We will need to remember to remove this file before @ghostdevv (or someone else) approves and merges the PR.

Copy link
Copy Markdown
Author

@IestynGage IestynGage May 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed said commit instead of reverting it for a better commit history.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For completeness I had started down the path of https://storybook.js.org/docs/writing-stories/mocking-data-and-modules/mocking-modules but I think this default story showing the actual static posts is appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants